﻿using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using FeatureManagement;
using FeatureManagement.Localization;
using Xms.Abp.Modularity;
using TenantManagement.Localization;
using Xms.Abp.AspNetCore.Mvc;

namespace MemberManagement;

[DependsOn(
    typeof(MemberManagementApplicationContractsModule),
    typeof(FeatureManagementHttpApiModule),
    typeof(XmsAbpAspNetCoreMvcModule)
    )]
public class MemberManagementHttpApiModule : XmsModule
{
    public override void PreConfigureServices(ServiceConfigurationContext context)
    {
        PreConfigure<IMvcBuilder>(mvcBuilder =>
        {
            mvcBuilder.AddApplicationPartIfNotExists(typeof(MemberManagementHttpApiModule).Assembly);
        });
    }

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpLocalizationOptions>(options =>
        {
            options.Resources
                .Get<MemberManagementResource>()
                .AddBaseTypes(
                    typeof(FeatureManagementResource),
                    typeof(AbpUiResource));
        });
    }
}
